home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / MacPerl 5.1.3 / Mac_Perl_513_src / perl5.002 / lib / syslog.pl < prev    next >
Encoding:
Text File  |  1996-07-11  |  811 b   |  33 lines  |  [TEXT/MPS ]

  1. #
  2. # syslog.pl
  3. #
  4. # $Log:    syslog.pl,v $
  5. # tom christiansen <tchrist@convex.com>
  6. # modified to use sockets by Larry Wall <lwall@jpl-devvax.jpl.nasa.gov>
  7. # NOTE: openlog now takes three arguments, just like openlog(3)
  8. #
  9. # call syslog() with a string priority and a list of printf() args
  10. # like syslog(3)
  11. #
  12. #  usage: require 'syslog.pl';
  13. #
  14. #  then (put these all in a script to test function)
  15. #        
  16. #
  17. #    do openlog($program,'cons,pid','user');
  18. #    do syslog('info','this is another test');
  19. #    do syslog('mail|warning','this is a better test: %d', time);
  20. #    do closelog();
  21. #    
  22. #    do syslog('debug','this is the last test');
  23. #    do openlog("$program $$",'ndelay','user');
  24. #    do syslog('notice','fooprogram: this is really done');
  25. #
  26. #    $! = 55;
  27. #    do syslog('info','problem was %m'); # %m == $! in syslog(3)
  28.  
  29. use Sys::Syslog;
  30.  
  31. 1;
  32.